import request from '@/utils/request';

export interface UserInfo {
  _id: number;
  phone: string;
  nickname: string;
  password: string;
  roleType: number;
  avatarUrl: string;
}

// 用户登录
export function http_user_login(params: any) {
  return request({
    url: '/api/user/login',
    method: 'post',
    data: params
  });
}

// 用户注册
export function http_user_register(params: any) {
  return request({
    url: '/api/user/register',
    method: 'post',
    data: params
  });
}

// 用户上传
export function http_user_upload(params: any) {
  return request({
    url: '/upload',
    method: 'post',
    data: params
  });
}

// 验证码
export function http_user_captcha() {
  return request({
    url: '/api/user/captcha',
    method: 'get'
  });
}
